<% session[:ret_post] = session[:return_to] = nil %>
<% form_for(@user_level_rule, :url=>{:action=>'create'}) do |ulr| %>
  <%= ulr.error_messages %>
  <h1>User Level Rule</h1>

  <%= ulr.text_field :name, :class=>"textInput" %>

  <h1>Can View</h1>
  <select name="user_level_rule[view_level_id]" class="textInput">
    <% @user_levels.each do |ul| %>
      <% if ul.name == "Public" %>
        <option selected="selected" value="<%= ul.id %>"><%= ul.name %></option>
      <% else %>
        <option value="<%= ul.id %>"><%= ul.name %></option>
      <% end %>
    <% end %>
  </select>

  <h1>Can Post</h1>
  <select name="user_level_rule[post_level_id]" class="textInput">
    <% @user_levels.each do |ul| %>
      <% if ul.name == "Public" %>
        <option selected="selected" value="<%= ul.id %>"><%= ul.name %></option>
      <% else %>
        <option value="<%= ul.id %>"><%= ul.name %></option>
      <% end %>
    <% end %>
  </select>

  <h1>Can Reply</h1>
  <select name="user_level_rule[reply_level_id]" class="textInput">
    <% @user_levels.each do |ul| %>
      <% if ul.name == "Public" %>
        <option selected="selected" value="<%= ul.id %>"><%= ul.name %></option>
      <% else %>
        <option value="<%= ul.id %>"><%= ul.name %></option>
      <% end %>
    <% end %>
  </select>

  <br/>
  <span class="new_post_submit"><%= ulr.submit "Submit", :class=>"button" %></span>
<%  end %>